package com.example.orderminiappapi.service.Impl;

import com.example.orderminiappapi.bean.Meal;
import com.example.orderminiappapi.bean.OrderItem;
import com.example.orderminiappapi.bean.Shop;
import com.example.orderminiappapi.dao.MealDao;
import com.example.orderminiappapi.dao.SearchDao;
import com.example.orderminiappapi.service.MealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MealServiceImpl implements MealService {

    @Autowired
    private MealDao mealDao;

    @Override
    public List<Meal> getShopMeals(Shop shop) {
        return mealDao.getShopMeals(shop);
    }

    @Override
    public int doAddMeal(Meal meal) {
        return mealDao.doAddMeal(meal);
    }

    @Override
    public int doUpdateMeal(Meal meal) {
        return mealDao.doUpdateMeal(meal);
    }

    @Override
    public int updateGround(Meal meal) {
        return mealDao.updateGround(meal);
    }

    @Override
    public int getAllShopMealsCount(Shop shop) {
        return mealDao.getAllShopMealsCount(shop);
    }

    @Override
    public int deleteMealItem(Meal meal) {
        return mealDao.deleteMealItem(meal);
    }

    @Override
    public Meal selectOneMeal(Meal meal) {
        return mealDao.selectOneMeal(meal);
    }

    @Override
    public int completeOrder(OrderItem orderItem) {
        return mealDao.completeOrder(orderItem);
    }
}
